<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>指令</title>
    <style>
        .active{
            color: red;
        }
    </style>
    <link rel="stylesheet" href="./css/bootstrap.min.css">
</head>

<body>
    <div id="app">
       <a v-bind:href="url1">百度</a>
       <a :href="url2" v-bind:[attr]="target">163</a>
       <a href="http://qq.com" v-on:click.prevent="handleClick">qq</a>
       <button @click="handleClick">点击我</button>
    </div>
    
    <script src="./js/vue.js"></script>
    <script>
        const app = new Vue({
            el: "#app",
            data: {
                url1:"http://baidu.com",
                url2:"http://163.com",
                attr:"target",
                target:"_blank"
            },
            methods:{
                handleClick:function(){
                    alert('点击按钮')
                }
            }

        })
    </script>
</body>

</html>